<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 定位符
    // ^  匹配字符串开始位置  (以...开头)
    // $  匹配字符串的结束位置 (以...结尾)

    var str = "daaaaaay";
    var reg = /^da+y$/i
    console.log(reg.test(str));
</script>
</html>